module.exports = app => {
    const { DATE, INTEGER ,DECIMAL,STRING,TEXT} = app.Sequelize;

    const Ad = app.model.define('t_ad', {
        id: { type: INTEGER(11), primaryKey: true, autoIncrement: true },
        admaster_id:{type:DECIMAL(20),'allowNull': false},
        name:{type:STRING(20),'allowNull': false},
        url:{type:STRING(255),'allowNull': false},
        ad_des:{type:STRING(20),'allowNull': false},
        createtime:{type:DATE},
        modifytime:{type:DATE},
        deadline:{type:DATE},
        budget:{type:DECIMAL(10),'allowNull': false},
        price:{type:DECIMAL(10),'allowNull': false},
        person_limit:{type:DECIMAL(10),'allowNull': false},
        isshow:{type:DECIMAL(1),'allowNull': false},
        checkinfo:{type:TEXT,'allowNull': false},
        area:{type:STRING(200),'allowNull': false},
        state:{type:DECIMAL(1),'allowNull': false},
        isdelete:{type:DECIMAL(1),'allowNull': false},
        usedpercent:{type:DECIMAL(3),'allowNull': false},
    }, {
        timestamps: false,  //去除createAt updateAt
        freezeTableName: true,  //使用自定义表名
    })
    return Ad;
};